<%--
  Created by IntelliJ IDEA.
  User: 杨大贵
  Date: 2024/4/11
  Time: 19:45
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <meta charset="UTF-8">
    <title>处理字符串</title>
    <style>
        body {
            font-family: Arial, sans-serif;
            background-color: #f4f4f4;
            margin: 0;
            padding: 0;
        }

        .container {
            max-width: 600px;
            margin: 20px auto;
            background-color: #fff;
            padding: 20px;
            border-radius: 5px;
            box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
        }

        h1 {
            text-align: center;
            color: #333;
        }

        p {
            margin-bottom: 10px;
        }
    </style>
</head>
<body>
<div class="container">
    <h1>处理字符串</h1>
    <% request.setCharacterEncoding("UTF-8"); %>
    <%
        // 获取从inputString.jsp提交的字符串
        String inputString = request.getParameter("inputString");
        // 计算字符串长度
        int length = inputString.length();
    %>
    <p>您输入的字符串是：<%= inputString %></p>
    <p>字符串长度为：<%= length %></p>
</div>
</body>
</html>